home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / demos / VisualAge for Java 2.0 Entry / setup / data1.cab / ide-e / IDE / cache / J5WDI7 (.txt) < prev    next >
Encoding:
Java Class File  |  1998-09-16  |  2.2 KB  |  59 lines

  1. package com.sun.java.swing.plaf.basic;
  2.  
  3. import java.awt.Component;
  4. import java.awt.Point;
  5. import java.awt.Rectangle;
  6. import java.awt.event.MouseEvent;
  7. import java.awt.event.MouseMotionAdapter;
  8. import java.util.EventObject;
  9.  
  10. class BasicComboPopup$InvocationMouseMotionListener extends MouseMotionAdapter {
  11.    // $FF: synthetic field
  12.    BasicComboPopup this$0;
  13.  
  14.    public void mouseDragged(MouseEvent e) {
  15.       if (this.this$0.isVisible()) {
  16.          MouseEvent newEvent = this.this$0.convertMouseEvent(e);
  17.          Rectangle r = new Rectangle();
  18.          this.this$0.list.computeVisibleRect(r);
  19.          if (newEvent.getPoint().y >= r.y) {
  20.             int var10001 = r.y + r.height;
  21.             if (newEvent.getPoint().y <= var10001 - 1) {
  22.                this.this$0.hasEntered = true;
  23.                if (this.this$0.isAutoScrolling) {
  24.                   this.this$0.stopAutoScrolling();
  25.                }
  26.  
  27.                Point location = newEvent.getPoint();
  28.                if (r.contains(location)) {
  29.                   this.this$0.valueIsAdjusting = true;
  30.                   this.this$0.updateListBoxSelectionForEvent(newEvent, false);
  31.                   this.this$0.valueIsAdjusting = false;
  32.                }
  33.  
  34.                return;
  35.             }
  36.          }
  37.  
  38.          if (this.this$0.hasEntered) {
  39.             int directionToScroll = newEvent.getPoint().y < r.y ? 0 : 1;
  40.             if (this.this$0.isAutoScrolling && this.this$0.scrollDirection != directionToScroll) {
  41.                this.this$0.stopAutoScrolling();
  42.                this.this$0.startAutoScrolling(directionToScroll);
  43.             } else if (!this.this$0.isAutoScrolling) {
  44.                this.this$0.startAutoScrolling(directionToScroll);
  45.             }
  46.          } else if (e.getPoint().y < ((Component)((EventObject)e).getSource()).getBounds().y) {
  47.             this.this$0.hasEntered = true;
  48.             this.this$0.startAutoScrolling(0);
  49.          }
  50.       }
  51.  
  52.    }
  53.  
  54.    // $FF: synthetic method
  55.    BasicComboPopup$InvocationMouseMotionListener(BasicComboPopup this$0) {
  56.       this.this$0 = this$0;
  57.    }
  58. }
  59.